package com.ruoyi.project.wenyanwen.generatelog.domain;

import com.ruoyi.common.utils.SizeUtil;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.util.Date;

/**
 * 数据包浏览对象 db_generate_log
 *
 * @author shixiangwen
 * @date 2020-09-27
 */
public class DbGenerateLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 数据库
     */
    @Excel(name = "数据库")
    private String dbName;

    /**
     * 文件名
     */
    @Excel(name = "文件名")
    private String fileName;

    /**
     * md5
     */
    @Excel(name = "md5")
    private String md5;

    /**
     * 大小
     */
    @Excel(name = "大小")
    private Long size;

    /**
     * 打包用户
     */
    @Excel(name = "打包用户")
    private String createdUser;

    private String sizeFormat;

    public String getSizeFormat() {
        return SizeUtil.sizeFormat(size);
    }

    public void setSizeFormat(String sizeFormat) {
        this.sizeFormat = sizeFormat;
    }

    private int uploadStatus;

    private int version;

    /**
     * 打包时间
     */
    @Excel(name = "打包时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getDbName() {
        return dbName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getMd5() {
        return md5;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getSize() {
        return size;
    }

    public void setCreatedUser(String createdUser) {
        this.createdUser = createdUser;
    }

    public String getCreatedUser() {
        return createdUser;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public int getUploadStatus() {
        return uploadStatus;
    }

    public void setUploadStatus(int uploadStatus) {
        this.uploadStatus = uploadStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("dbName", getDbName())
                .append("fileName", getFileName())
                .append("md5", getMd5())
                .append("size", getSize())
                .append("createdUser", getCreatedUser())
                .append("createdTime", getCreatedTime())
                .toString();
    }
}
